<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<header class="page">
    <div class="status">
        <ul class="nav justify-content-end">
            <c:choose>
                <%--若会话对象中存在customer则认为用于已经登录--%>
                <c:when test="${ not empty sessionScope.customer }">
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/publish">
                            <i class="fa fa-external-link" aria-hidden="true"></i>发布话题
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/topic/mine">
                            <i class="fa fa-envelope-open-o" ></i>我的话题
                        </a>
                    </li>
                    <li class="nav-item">
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
                            <i class="fa fa-cog"></i>设置
                        </a>
                        <ul class="dropdown-menu dropdown-user ">
                            <li>
                                <a href="${ctxPath}/customer/change">
                                    <i class="fa fa-user fa-fw"></i> 修改密码
                                </a>
                            </li>
                            <li><a href="${ctxPath}/customer/sign/setting"><i class="fa fa-paper-plane"></i> 修改昵称</a>
                            </li>
                            <li class="divider"></li>
                            <li><a href="${ctxPath}/customer/view">
                                <i class="fa fa-sign-out fa-fw"></i> 查看主页</a>
                            </li>
                            <li>

                                <a href="${ctxPath}/customer/sign/remove" >
                                    <i class="fa fa-user-times" aria-hidden="true"></i>注销账号</a>
                            </li>
                        </ul>
                        <!-- /.dropdown-user -->
                    </li>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/out">
                            <i class="fa fa-user-times" aria-hidden="true"></i> 退出
                        </a>
                    </li>
                </c:when>
                <c:otherwise>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/up">
                            <i class="fa fa-user-plus" aria-hidden="true"></i>注册
                        </a>
                    </li>
                    <li class="nav-item">
                        <a href="${ctxPath}/customer/sign/in">
                            <i class="fa fa-user" aria-hidden="true"></i>登录
                        </a>
                    </li>
                </c:otherwise>
            </c:choose>
        </ul>
    </div>
    <div class="logo row justify-content-center">
        <div class="logo col-4 ">
            <img src="/img/字体6.png">
            <c:choose>
                <c:when test="${not empty sessionScope.customer}">
                    <span class="welcome">
                欢迎${customer.nickname}
            </span>
                </c:when>
            </c:choose>

        </div>
        <form action="${ctxPath}/topic/search" method="post" name="search" class="search col-8 " >
            <div>
                <input name="keyword" type="text" placeholder="请输入……">
            </div>
            <div class="search-query">
                &nbsp;&nbsp;&nbsp;<button type="submit">搜索一下</button>
            </div>

        </form>
    </div>

    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</header>